package com.efast.dmom.equipment.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.efast.dmom.equipment.bean.EquipIdsParamBean;
import com.efast.dmom.equipment.bean.ResultBean;
import com.efast.dmom.equipment.service.masterdata.IEquipMasterDataService;

/**
 * 
 * @author 作者 Aaron Liu:
 * 
 * @version 创建时间：2019年8月13日 下午4:06:35
 * 
 *          类说明
 * 
 */
@Controller
@RequestMapping("/equipment")
public class EquipMasterDataController{

	@Autowired
	private IEquipMasterDataService equipMasterDataService;
	
	
	@RequestMapping(value = "/masterData/deleteEquipClass/{id}", method = RequestMethod.POST)
	public @ResponseBody void deleteEquipClass(@PathVariable Integer id) {
		equipMasterDataService.deleteEquipClassByIds(id);
	}

	
	@RequestMapping(value = "/masterData/deleteEquipCategory", method = RequestMethod.POST)
	public @ResponseBody void deleteEquipCategory(@RequestBody EquipIdsParamBean bean) {
		equipMasterDataService.deleteEquipCategoryByIds(bean.getIds());
	}

	
	@RequestMapping(value = "/masterData/deleteSpare", method = RequestMethod.POST)
	public @ResponseBody void deleteSpare(@RequestBody EquipIdsParamBean bean) {
		equipMasterDataService.deleteEquipSpareById(bean.getIds());
	}

	
	@RequestMapping(value = "/masterData/deleteBaseInfo", method = RequestMethod.POST)
	public @ResponseBody void deleteBaseInfo(@RequestBody EquipIdsParamBean bean) {
		equipMasterDataService.deleteEquipBaseInfoByIds(bean.getIds());
	}

	
	@RequestMapping(value = "/masterData/verifyEquipCode", method = RequestMethod.POST)
	public @ResponseBody ResultBean verifyEquipCode(@RequestBody EquipIdsParamBean bean) {
		return equipMasterDataService.verifyEquipCode(bean);
	}
    
	
	@RequestMapping(value = "/masterData/verifyEquipSpareCode", method = RequestMethod.POST)
	public @ResponseBody ResultBean verifyEquipSpareCode(@RequestBody EquipIdsParamBean bean) {
		return equipMasterDataService.verifyEquipSpareCode(bean);
	}
	
	@RequestMapping(value = "/masterData/spareDeleteVerify", method = RequestMethod.POST)
	public @ResponseBody ResultBean spareDeleteVerify(@RequestBody EquipIdsParamBean bean) {
		return equipMasterDataService.spareDeleteVerify(bean);
	}
	
	@RequestMapping(value = "/masterData/equipDeleteVerify", method = RequestMethod.POST)
	public @ResponseBody ResultBean equipDeleteVerify(@RequestBody EquipIdsParamBean bean) {
		return equipMasterDataService.equipDeleteVerify(bean);
	}
	
}
